package com.hjw.utils;

import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;

/**
 * @author Administrator
 * @创建时间：2025-04-11
 * @文件名称：satoken_sobuk - com.hjw.utils
 */
@Slf4j
public class Result implements Serializable {
    private Integer code;
    private String msg;
    private Object data;

    public Result(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public Result(String msg, Object data) {
        this.code = 200;
        this.msg = msg;
        this.data = data;
    }

    @Override
    public String toString() {
        log.info("Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}');
        return "Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
